package Day36.test2;

/**
 * 链表的节点对象
 * 双向链表的节点：
 *  1.前驱-前一个元素
 *  2.数据-本身的数据
 *  3.后继-后一个元素
 */
public class Node {
    private Node pre;//前一个元素
    private Object data;//数据
    private Node next;//下一个元素

    public Node() {
    }

    public Node(Object data) {
        this.data = data;
    }

    public Node(Node pre, Object data, Node next) {
        this.pre = pre;
        this.data = data;
        this.next = next;
    }

    public Node getPre() {
        return pre;
    }

    public void setPre(Node pre) {
        this.pre = pre;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Node getNext() {
        return next;
    }

    public void setNext(Node next) {
        this.next = next;
    }


    /*@Override
    public String toString() {
        return "Node{" +
                "pre=" + pre +
                ", data=" + data +
                ", next=" + next +
                '}';
    }*/
}
